package com.zhq.zhq_blog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhq.zhq_blog.entity.Reply;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 回复Mapper接口
 */
@Repository
public interface ReplyMapper extends BaseMapper<Reply> {

    //查询与commentId关联的所有回复
    @Select("SELECT * FROM tb_reply WHERE tb_reply.comment_id = #{comment_id}")
    List<Reply> queryAllReply(@Param("comment_id") Integer comment_id);

}
